# Maintainer: Petr Hodina <phodina@protonmail.com>
pkgname=optee-client
pkgver=3.20.0
pkgrel=0
pkgdesc="Normal World Client side of tee"
url="https://github.com/OP-TEE/optee_client"
arch="aarch64 armv7"
license="BSD-2-Clause"
makedepends="
	bsd-compat-headers
	cmake
	linux-headers
	samurai
	util-linux-dev
	"
subpackages="$pkgname-dev $pkgname-libs"
source="$pkgname-$pkgver.tar.gz::https://github.com/OP-TEE/optee_client/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/optee_client-$pkgver"
# requires more dependencies
options="!check"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=None \
		-DCFG_TEE_CLIENT_LOG_FILE=/var/log/tee/teec.log \
		-DBUILD_SHARED_LIBS=ON
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	mkdir -p "$pkgdir"/var/log/tee
}

sha512sums="
678db0b9c5c2a0332120e737ddd2c4d83e6e6b0e2a09fa53b61edf3dd9586268314d4cd429833d9baf1f77fd6b0a78ea5b828b62bcfb00ad59bdbab494b0842b  optee-client-3.20.0.tar.gz
"
